Skip to content

PM-3575 - handle BA Admin user#138

Merged
vas3a merged 2 commits into
devfrom
PM-3575_handle-ba-admin-user
Jan 29, 2026
Merged

PM-3575 - handle BA Admin user#138
vas3a merged 2 commits into
devfrom
PM-3575_handle-ba-admin-user

Conversation

@vas3a

@vas3a vas3a commented Jan 28, 2026

Copy link
Copy Markdown
Collaborator

@vas3a
vas3a requested a review from kkartunov January 28, 2026 08:27
Comment thread src/api/admin/admin.controller.ts
Comment thread src/api/admin/admin.controller.ts
Comment thread src/api/admin/admin.controller.ts
Comment thread src/api/admin/admin.controller.ts
Comment thread src/api/admin/admin.controller.ts
Comment thread src/api/admin/admin.controller.ts
Comment thread src/api/admin/admin.controller.ts
Comment thread src/api/admin/admin.controller.ts
Comment thread src/api/admin/admin.controller.ts
Comment thread src/api/admin/admin.controller.ts
Comment thread src/api/admin/admin.controller.ts
@User() user: any,
): Promise<ResponseDto<AuditPayoutDto[]>> {
if (this.isBaAdmin(user)) {
await this.adminService.verifyBaAdminAccessToWinning(winningId, user.id);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ security]
The method verifyBaAdminAccessToWinning is called to verify access. Ensure that this method handles all edge cases and potential errors, such as invalid winningId or user ID, to prevent security vulnerabilities.

) {}

async getBillingAccountsForUser(userId: string): Promise<string[]> {
const baPrisma = getBaClient();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ maintainability]
Consider handling potential errors when calling getBaClient() to ensure the application can gracefully handle any issues with the database connection.


async getBillingAccountsForUser(userId: string): Promise<string[]> {
const baPrisma = getBaClient();
const baRows = await baPrisma.billingAccountAccess.findMany({

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ performance]
The findMany operation could potentially return a large dataset. Consider adding pagination or limiting the number of results to improve performance and prevent excessive memory usage.


return {
...filters,
billingAccounts: await this.getBillingAccountsForUser(userId),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ correctness]
The billingAccounts field in the returned object could be undefined if getBillingAccountsForUser returns an empty array. Ensure that the consuming code handles this scenario appropriately.

select: {
billing_account: true,
}
});;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[💡 style]
Remove the extra semicolon at the end of the statement. It is unnecessary and could lead to confusion.

}
});;

if (!payments || payments.length === 0) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ correctness]
Consider handling the case where payments is null or undefined explicitly before checking payments.length. This will improve clarity and ensure robustness.

.map((p) => p.billing_account)
.filter((b) => b !== null && b !== undefined);

const unauthorized = paymentBAs.some((ba) => !allowedBAs.includes(`${ba}`));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ correctness]
The use of includes with string interpolation (${ba}) could lead to unexpected results if allowedBAs contains non-string elements. Ensure that allowedBAs is an array of strings to avoid potential type issues.

async updateWinnings(
body: WinningUpdateRequestDto,
userId: string,
isBaAdmin?: boolean,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ security]
The addition of the isBaAdmin parameter should be carefully considered for its impact on the method's logic. Ensure that the parameter is used securely and correctly within the method to prevent unauthorized access or incorrect behavior. If this parameter affects authorization logic, it should be validated and documented appropriately.

this.logger.log(`updateWinnings payload: ${JSON.stringify(body)}`);

if (isBaAdmin) {
await this.verifyBaAdminAccessToWinning(body.winningsId, userId);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ correctness]
Consider handling potential errors from verifyBaAdminAccessToWinning. If this function throws an error, it might cause the entire operation to fail without a clear error message or recovery path.

throw new NotFoundException('failed to get current payments');
}


Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[💡 style]
Remove the unnecessary blank lines to maintain code consistency and avoid unnecessary diff noise.

externalIds?: string[],
date?: DateFilterType,
): Prisma.winningsFindManyArgs['where'] {
): Prisma.winningsWhereInput {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
The return type has been changed from Prisma.winningsFindManyArgs['where'] to Prisma.winningsWhereInput. Ensure that this change is intentional and that all usages of this method are compatible with the new return type. This change could potentially impact the correctness of the code if not handled properly.

if (searchProps.billingAccounts) {
// override payment filter to include billing account constraint
// while preserving status/installment constraints
(queryWhere as any).payment.some = {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ maintainability]
Casting queryWhere to any can lead to runtime errors if the structure of queryWhere changes unexpectedly. Consider defining a proper type for queryWhere to ensure type safety and maintainability.

// override payment filter to include billing account constraint
// while preserving status/installment constraints
(queryWhere as any).payment.some = {
...queryWhere.payment!.some,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
The use of non-null assertion ! on queryWhere.payment assumes that payment is always defined. If payment can be undefined, this will cause a runtime error. Consider adding a check to ensure payment is defined before accessing its properties.

Comment thread src/config/config.env.ts
id: userId,
handle: userHandle,
email: request.email,
roles: userRoles,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ security]
Ensure that userRoles is properly validated and sanitized before being assigned to the roles property. This is important to prevent potential security vulnerabilities such as injection attacks if userRoles can be influenced by external input.

Comment thread src/dto/winning.dto.ts
@IsOptional()
@IsArray()
@ArrayNotEmpty()
@IsString({ each: true })

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[💡 maintainability]
The @IsString({ each: true }) decorator is redundant here because @IsNotEmpty({ each: true }) already ensures that each element is a non-empty string. Consider removing @IsString({ each: true }) to simplify the validation logic.

Comment thread src/shared/global/ba-prisma.client.ts Outdated
Comment thread src/shared/global/ba-prisma.client.ts Outdated
Comment thread src/shared/global/ba-prisma.client.ts Outdated
Comment thread pnpm-lock.yaml
version: 6.19.2(prisma@6.19.2(typescript@5.9.3))(typescript@5.9.3)
'@topcoder/billing-accounts-api-v6':
specifier: github:topcoder-platform/billing-accounts-api-v6#develop
version: billing-accounts-api-v6@https://codeload.github.com/topcoder-platform/billing-accounts-api-v6/tar.gz/cfd4a7eedf2d3f33c6c615372895592c6d723aaa(@swc/cli@0.7.10(@swc/core@1.15.11)(chokidar@4.0.3))(@swc/core@1.15.11)(@types/node@24.10.9)(express@5.2.1)(rxjs@7.8.2)(typescript@5.9.3)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ maintainability]
The addition of the @topcoder/billing-accounts-api-v6 dependency from a GitHub repository using a specific commit hash can lead to potential issues with reproducibility and maintainability. Consider using a versioned release or tag instead to ensure consistent builds and easier updates.

Comment thread pnpm-lock.yaml
engines: {node: '>=18'}
peerDependencies:
'@types/node': '>=18'
peerDependenciesMeta:
'@types/node':
optional: true

'@inquirer/prompts@7.8.0':
resolution: {integrity: sha512-JHwGbQ6wjf1dxxnalDYpZwZxUEosT+6CPGD9Zh4sm9WXdtUp9XODCQD3NjSTmu+0OAyxWXNOqf0spjIymJa2Tw==}
'@inquirer/prompts@7.3.2':

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
Downgrading the version of @inquirer/prompts from 7.8.0 to 7.3.2 could introduce bugs or remove important features or fixes that were present in the newer version. Ensure that this downgrade is intentional and verify that it does not negatively impact the functionality or security of the application.

Comment thread pnpm-lock.yaml
'@nestjs/common@11.1.7':
resolution: {integrity: sha512-lwlObwGgIlpXSXYOTpfzdCepUyWomz6bv9qzGzzvpgspUxkj0Uz0fUJcvD44V8Ps7QhKW3lZBoYbXrH25UZrbA==}
'@nestjs/common@10.4.22':
resolution: {integrity: sha512-fxJ4v85nDHaqT1PmfNCQ37b/jcv2OojtXTaK1P2uAXhzLf9qq6WNUOFvxBrV4fhQek1EQoT1o9oj5xAZmv3NRw==}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
The downgrade from @nestjs/common@11.1.7 to @nestjs/common@10.4.22 could introduce compatibility issues if other parts of the codebase rely on features or bug fixes present only in the newer version. Ensure that all dependencies and code are compatible with this version.

Comment thread pnpm-lock.yaml
class-validator:
optional: true

'@nestjs/common@11.1.12':

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ maintainability]
The presence of two different versions of @nestjs/common (10.4.22 and 11.1.12) in the lock file could lead to unexpected behavior due to version conflicts. Consider consolidating to a single version to avoid potential issues.

Comment thread pnpm-lock.yaml
@@ -860,6 +902,19 @@ packages:
'@nestjs/websockets':
optional: true

'@nestjs/mapped-types@2.0.5':

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ maintainability]
The addition of @nestjs/mapped-types@2.0.5 seems unnecessary since @nestjs/mapped-types@2.1.0 is already present. Having multiple versions of the same package can lead to increased bundle size and potential conflicts. Consider consolidating to a single version unless there is a specific need for both.

Comment thread pnpm-lock.yaml
'@nestjs/platform-express@11.1.7':
resolution: {integrity: sha512-5T+GLdvTiGPKB4/P4PM9ftKUKNHJy8ThEFhZA3vQnXVL7Vf0rDr07TfVTySVu+XTh85m1lpFVuyFM6u6wLNsRA==}
'@nestjs/platform-express@10.4.22':
resolution: {integrity: sha512-ySSq7Py/DFozzZdNDH67m/vHoeVdphDniWBnl6q5QVoXldDdrZIHLXLRMPayTDh5A95nt7jjJzmD4qpTbNQ6tA==}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
The downgrade from @nestjs/platform-express@11.1.7 to @nestjs/platform-express@10.4.22 may introduce compatibility issues if other parts of the application rely on features or bug fixes present in version 11. Ensure that all dependencies and the application code are compatible with this version change.

Comment thread pnpm-lock.yaml
'@nestjs/common': ^10.0.0
'@nestjs/core': ^10.0.0

'@nestjs/platform-express@11.1.12':

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ maintainability]
Having two versions of @nestjs/platform-express (10.4.22 and 11.1.12) in the lock file can lead to unexpected behavior due to potential conflicts between the versions. Consider consolidating to a single version to maintain consistency.

Comment thread pnpm-lock.yaml
'@prisma/client@6.18.0':
resolution: {integrity: sha512-jnL2I9gDnPnw4A+4h5SuNn8Gc+1mL1Z79U/3I9eE2gbxJG1oSA+62ByPW4xkeDgwE0fqMzzpAZ7IHxYnLZ4iQA==}
'@prisma/client@6.19.2':
resolution: {integrity: sha512-gR2EMvfK/aTxsuooaDA32D8v+us/8AAet+C3J1cc04SW35FPdZYgLF+iN4NDLUgAaUGTKdAB0CYenu1TAgGdMg==}
engines: {node: '>=18.18'}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
The node engine version requirement has been updated to >=18.18. Ensure that this change is compatible with the deployment environment and does not inadvertently exclude any necessary environments. This could impact the ability to run the application if the infrastructure is not updated accordingly.

Comment thread pnpm-lock.yaml
resolution: {integrity: sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==}
engines: {node: '>=8.0.0'}

axios@0.30.2:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ security]
The downgrade of axios from version 1.12.2 to 0.30.2 could introduce compatibility or security issues. Ensure that this version change is intentional and that the older version meets all current security and functionality requirements.

Comment thread pnpm-lock.yaml
axios@0.30.2:
resolution: {integrity: sha512-0pE4RQ4UQi1jKY6p7u6i1Tkzqmu+d+/tHS7Q7rKunWLB9WyilBTpHHpXzPNMDj5hTbK0B0PTLSz07yqMBiF6xg==}

axios@1.13.4:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ maintainability]
There are multiple versions of axios specified (0.30.2 and 1.13.4). This can lead to version conflicts and unexpected behavior. Consider consolidating to a single version to maintain consistency.

Comment thread pnpm-lock.yaml
body-parser@2.2.0:
resolution: {integrity: sha512-02qvAaxv8tp7fBa/mw1ga98OGm+eCbqzJOKoRt70sLmfEEi+jyBYVTDGfCL/k06/4EMk/z01gCe7HoCH/f2LTg==}
body-parser@1.20.4:
resolution: {integrity: sha512-ZTgYYLMOXY9qKU/57FAo8F+HA2dGX7bqGc71txDRC1rS4frdFI5R7NhluHxH6M0YItAP0sHB4uqAOcYKxO6uGA==}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
The downgrade from body-parser@2.2.0 to body-parser@1.20.4 could potentially introduce compatibility issues or missing features if the codebase relies on features from the newer version. Ensure that the application is tested thoroughly to confirm that all functionalities work as expected with the older version.

Comment thread pnpm-lock.yaml
resolution: {integrity: sha512-ZTgYYLMOXY9qKU/57FAo8F+HA2dGX7bqGc71txDRC1rS4frdFI5R7NhluHxH6M0YItAP0sHB4uqAOcYKxO6uGA==}
engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16}

body-parser@2.2.2:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ maintainability]
The addition of body-parser@2.2.2 alongside body-parser@1.20.4 might lead to version conflicts or unexpected behavior if both versions are used in the codebase. Consider consolidating to a single version unless there is a specific need for both.

Comment thread pnpm-lock.yaml
@@ -1703,6 +1792,11 @@ packages:
buffer@5.7.1:
resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==}

bunyan@1.8.15:
resolution: {integrity: sha512-0tECWShh6wUysgucJcBAoYegf3JJoZWibxdqhTm7OHPeT42qdjkZ29QCMcKwbgU1kiH+auSIasNRXMLWXafXig==}
engines: {'0': node >=0.10.0}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
The engine specification '0': node >=0.10.0 seems incorrect. It should be node: '>=0.10.0' to properly specify the Node.js version requirement.

Comment thread pnpm-lock.yaml
@@ -1875,6 +1975,9 @@ packages:
confbox@0.2.2:
resolution: {integrity: sha512-1NB+BKqhtNipMsov4xI/NnhCKp9XG9NamYp5PVm9klAT0fsrNPjaFICsCFhNhwZJKNh7zB/3q8qXz0E9oaMNtQ==}

consola@2.15.3:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ maintainability]
The addition of consola@2.15.3 alongside consola@3.4.2 may lead to potential version conflicts or unexpected behavior due to differences between major versions. Consider consolidating to a single version unless both are explicitly required.

Comment thread pnpm-lock.yaml
engines: {node: '>= 0.6'}
content-disposition@1.0.1:
resolution: {integrity: sha512-oIXISMynqSqm241k6kcQ5UwttDILMK4BiurCfGEREw6+X9jkkpEe5T9FZaApyLGGOnFuyMWZpdolTXMtvEJ08Q==}
engines: {node: '>=18'}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ maintainability]
The engines field for content-disposition@1.0.1 specifies node: '>=18', which is a significant jump from the previous >= 0.6. Ensure that this change is compatible with the environments where this package will be deployed, as it may require updating Node.js to version 18 or higher.

Comment thread pnpm-lock.yaml
@@ -2196,12 +2330,16 @@ packages:
resolution: {integrity: sha512-u/feCi0GPsI+988gU2FLcsHyAHTU0MX1Wg68NhAnN7z/+C5wqG+CY8J53N9ioe8RXgaoz0nBR/TYMf3AycUuPw==}
engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0}

express@5.1.0:
resolution: {integrity: sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA==}
express@4.22.1:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
The downgrade from express@5.1.0 to express@4.22.1 could potentially introduce compatibility issues or missing features that were available in version 5. Ensure that this change is intentional and that any dependencies on version 5 features are addressed.

Comment thread pnpm-lock.yaml
resolution: {integrity: sha512-F2X8g9P1X7uCPZMA3MVf9wcTqlyNp7IhH5qPCI0izhaOIYXaW9L535tGA3qmjRzpH+bZczqq7hVKxTR4NWnu+g==}
engines: {node: '>= 0.10.0'}

express@5.2.1:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ maintainability]
The addition of express@5.2.1 alongside express@4.22.1 could lead to multiple versions of the same library being used, which might cause unexpected behavior. Verify if both versions are necessary and consider consolidating to a single version if possible.

Comment thread pnpm-lock.yaml
finalhandler@2.1.0:
resolution: {integrity: sha512-/t88Ty3d5JWQbWYgaOGCCYfXRwV1+be02WqYYlL6h0lEiUAMPM8o8qKGO01YIkOHzka2up08wvgYD0mDiI+q3Q==}
finalhandler@1.3.2:
resolution: {integrity: sha512-aA4RyPcd3badbdABGDuTXCMTtOneUCAYH/gxoYRTZlIJdF0YPWuGqiAsIrhNnnqdXGswYk6dGujem4w80UJFhg==}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
The downgrade of finalhandler from version 2.1.0 to 1.3.2 could introduce compatibility issues or missing features if the code relies on newer functionalities. Ensure that the codebase is compatible with this older version.

Comment thread pnpm-lock.yaml
engines: {node: '>= 0.8'}

finalhandler@2.1.1:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
The addition of finalhandler@2.1.1 with a node engine requirement of >= 18.0.0 may cause issues if the deployment environment does not meet this requirement. Verify that the deployment environment supports Node.js 18 or higher.

Comment thread pnpm-lock.yaml
@@ -2347,6 +2486,10 @@ packages:
resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==}
engines: {node: '>= 0.6'}

fresh@0.5.2:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ maintainability]
The addition of fresh@0.5.2 alongside fresh@2.0.0 suggests that there might be multiple versions of the same package in use. This can lead to increased bundle size and potential conflicts. Consider consolidating to a single version if possible.

Comment thread pnpm-lock.yaml
engines: {node: 20 || >=22}
hasBin: true

glob@6.0.4:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ maintainability]
The addition of glob@6.0.4 is marked as deprecated. Consider updating to a supported version to ensure future compatibility and avoid potential security vulnerabilities.

Comment thread pnpm-lock.yaml
@@ -2788,19 +2927,19 @@ packages:
jsonfile@6.2.0:
resolution: {integrity: sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==}

jsonwebtoken@9.0.2:
resolution: {integrity: sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==}
jsonwebtoken@9.0.3:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ security]
The update from jsonwebtoken@9.0.2 to jsonwebtoken@9.0.3 should be verified for any breaking changes or deprecations that might affect the current implementation. Ensure that the new version is compatible with existing code, especially if there are any security patches or changes in token handling.

Comment thread pnpm-lock.yaml
engines: {node: '>=12', npm: '>=6'}

jwa@1.4.2:
resolution: {integrity: sha512-eeH5JO+21J78qMvTIDdBXidBd6nG2kZjg5Ohz/1fpa28Z4CcsWUzJ1ZZyFq/3z3N17aZy+ZuBoHljASbL1WfOw==}
jwa@2.0.1:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
The update from jwa@1.4.2 to jwa@2.0.1 indicates a major version change. Major version changes can introduce breaking changes. Review the changelog or release notes to ensure that the new version does not introduce any breaking changes that could affect the cryptographic operations.

Comment thread pnpm-lock.yaml
jwks-rsa@3.2.0:
resolution: {integrity: sha512-PwchfHcQK/5PSydeKCs1ylNym0w/SSv8a62DgHJ//7x2ZclCoinlsjAfDxAAbpoTPybOum/Jgy+vkvMmKz89Ww==}
jwks-rsa@3.2.2:
resolution: {integrity: sha512-BqTyEDV+lS8F2trk3A+qJnxV5Q9EqKCBJOPti3W97r7qTympCZjb7h2X6f2kc+0K3rsSTY1/6YG2eaXKoj497w==}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ security]
The update from jwks-rsa@3.2.0 to jwks-rsa@3.2.2 is a minor version change, but it's still important to verify if there are any changes in the way JSON Web Key Sets are handled, especially if there are security implications.

Comment thread pnpm-lock.yaml
jws@3.2.2:
resolution: {integrity: sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==}
jws@4.0.1:
resolution: {integrity: sha512-EKI/M/yqPncGUUh44xz0PxSidXFr/+r0pA70+gIYhjv+et7yxM+s29Y+VGDkovRofQem0fs7Uvf4+YmAdyRduA==}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
The update from jws@3.2.2 to jws@4.0.1 involves a major version change. Ensure that the new version does not introduce breaking changes, particularly in the way JSON Web Signatures are created or verified, as this could impact the security and correctness of token handling.

Comment thread pnpm-lock.yaml
@@ -2936,17 +3078,16 @@ packages:
resolution: {integrity: sha512-UERzLsxzllchadvbPs5aolHh65ISpKpM+ccLbOJ8/vvpBKmAWf+la7dXFy7Mr0ySHbdHrFv5kGFCUHHe6GFEmw==}
engines: {node: '>= 4.0.0'}

merge-descriptors@1.0.3:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ maintainability]
The addition of merge-descriptors@1.0.3 alongside merge-descriptors@2.0.0 could lead to potential conflicts or unexpected behavior due to version discrepancies. Ensure that both versions are necessary, or consider consolidating to a single version to avoid compatibility issues.

Comment thread pnpm-lock.yaml
engines: {node: '>= 0.6'}
mime-types@3.0.2:
resolution: {integrity: sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==}
engines: {node: '>=18'}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ maintainability]
The engines field for mime-types@3.0.2 specifies node: '>=18'. Ensure that this version requirement is compatible with the environments where this package will be deployed, as it may not be supported in older Node.js environments.

Comment thread pnpm-lock.yaml
@@ -3010,6 +3159,12 @@ packages:
resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==}
hasBin: true

moment@2.30.1:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ maintainability]
The addition of moment@2.30.1 should be evaluated carefully as Moment.js is considered a legacy project and is in maintenance mode. Consider using a more modern library like date-fns or luxon for date manipulation to ensure long-term maintainability and support.

Comment thread pnpm-lock.yaml
moment@2.30.1:
resolution: {integrity: sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==}

ms@2.0.0:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ maintainability]
The addition of ms@2.0.0 alongside ms@2.1.3 could lead to potential issues with multiple versions of the same package being included in the project. Ensure that both versions are necessary, or consider consolidating to a single version to avoid unnecessary bloat and potential conflicts.

Comment thread pnpm-lock.yaml
@@ -3050,27 +3220,36 @@ packages:
node-fetch-native@1.6.7:
resolution: {integrity: sha512-g9yhqoedzIUm0nTnTqAQvueMPVOuIY16bqgAJJC8XOOubYFNwz6IER9qs0Gq2Xd0+CecCKFjtdDTMA4u4xG06Q==}

node-fetch@2.7.0:
resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==}
engines: {node: 4.x || >=6.0.0}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ security]
The node-fetch@2.7.0 package specifies support for Node.js version 4.x || >=6.0.0. Ensure that this aligns with the project's Node.js version requirements, as using an outdated Node.js version could lead to security vulnerabilities and lack of support for modern features.

Comment thread pnpm-lock.yaml
engines: {node: ^14.16.0 || >=16.10.0}
nypm@0.6.4:
resolution: {integrity: sha512-1TvCKjZyyklN+JJj2TS3P4uSQEInrM/HkkuSXsEzm1ApPgBffOn8gFguNnZf07r/1X6vlryfIqMUkJKQMzlZiw==}
engines: {node: '>=18'}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
The nypm@0.6.4 package now requires Node.js version >=18. Verify that this version requirement is compatible with the project's current Node.js environment to prevent runtime issues.

Comment thread pnpm-lock.yaml
randombytes@2.1.0:
resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==}

range-parser@1.2.1:
resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==}
engines: {node: '>= 0.6'}

raw-body@3.0.1:
resolution: {integrity: sha512-9G8cA+tuMS75+6G/TzW8OtLzmBDMo8p1JRxN5AZ+LAp8uxGA8V8GZm4GQ4/N5QNQEnLmg6SS7wyuSmbKepiKqA==}
raw-body@2.5.3:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
The downgrade from raw-body@3.0.1 to raw-body@2.5.3 might introduce compatibility issues or missing features, especially if the codebase relies on features from version 3.x. Ensure that the downgrade is intentional and that all dependencies are compatible with this version.

Comment thread pnpm-lock.yaml
reconnect-core@1.3.0:
resolution: {integrity: sha512-+gLKwmyRf2tjl6bLR03DoeWELzyN6LW9Xgr3vh7NXHHwPi0JC0N2TwPyf90oUEBkCRcD+bgQ+s3HORoG3nwHDg==}

reflect-metadata@0.1.14:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ maintainability]
There are two versions of reflect-metadata listed: 0.1.14 and 0.2.2. Having multiple versions of the same package can lead to unexpected behavior and increased bundle size. Consider consolidating to a single version if possible.

Comment thread pnpm-lock.yaml
engines: {iojs: '>=1.0.0', node: '>=0.10.0'}
rimraf@2.4.5:
resolution: {integrity: sha512-J5xnxTyqaiw06JjMftq7L9ouA448dw/E7dKghkP9WpKNuwmARNNg+Gk8/u5ryb9N/Yo2+z3MCwuqFK/+qPOPfQ==}
deprecated: Rimraf versions prior to v4 are no longer supported

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ maintainability]
The rimraf@2.4.5 package is marked as deprecated. Consider upgrading to a supported version to ensure future compatibility and security.

Comment thread pnpm-lock.yaml
@@ -3384,15 +3617,23 @@ packages:
engines: {node: '>=10'}
hasBin: true

send@1.2.0:
resolution: {integrity: sha512-uaW0WwXKpL9blXE2o0bRhoL2EGXIrZxQ2ZQ4mgcfoBxdFmQold+qWsD2jLrfZ0trjKL6vOw0j//eAwcALFjKSw==}
send@0.19.2:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ security]
The downgrade from send@1.2.0 to send@0.19.2 could introduce security vulnerabilities or bugs that were fixed in later versions. Ensure that this change is intentional and that any potential issues have been assessed.

Comment thread pnpm-lock.yaml
engines: {node: '>= 18'}

serialize-javascript@6.0.2:
resolution: {integrity: sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==}

serve-static@2.2.0:
resolution: {integrity: sha512-61g9pCh0Vnh7IutZjtLGGpTA355+OPn2TyDv/6ivP2h/AdAVX9azsoxmg2/M6nZeQZNYBEwIcsne1mJd9oQItQ==}
serve-static@1.16.3:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ security]
The downgrade from serve-static@2.2.0 to serve-static@1.16.3 may reintroduce bugs or security vulnerabilities that were addressed in later versions. Verify that this downgrade is necessary and that any risks have been evaluated.

Comment thread pnpm-lock.yaml
resolution: {integrity: sha512-5uC6DDlmeqiOwCPmK9jMSdOuZTh8bU39Ys6yidB+UTt5hfZUPGAypSgFRiEp+jbi9qH40BLDvy85jIU88wKSqw==}
tinyexec@1.0.2:
resolution: {integrity: sha512-W/KYk+NFhkmsYpuHq5JykngiOCnxeVL8v8dFnqxSD8qEEdRfXk1SDM6JzNqcERbcGYj9tMrDQBYV9cjgnunFIg==}
engines: {node: '>=18'}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ maintainability]
The addition of the engines field specifying node: '>=18' for tinyexec@1.0.2 introduces a new Node.js version requirement. Ensure that this version constraint is compatible with the deployment environment and other dependencies, as it may affect runtime compatibility.

Comment thread pnpm-lock.yaml
dependencies:
'@nestjs/common': 11.1.7(class-transformer@0.5.1)(class-validator@0.14.2)(reflect-metadata@0.2.2)(rxjs@7.8.2)
'@nestjs/core': 11.1.7(@nestjs/common@11.1.7(class-transformer@0.5.1)(class-validator@0.14.2)(reflect-metadata@0.2.2)(rxjs@7.8.2))(@nestjs/platform-express@11.1.7)(reflect-metadata@0.2.2)(rxjs@7.8.2)
'@nestjs/common': 10.4.22(class-transformer@0.5.1)(class-validator@0.14.3)(reflect-metadata@0.1.14)(rxjs@7.8.2)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
The downgrade of @nestjs/common from version 11.1.7 to 10.4.22 could potentially introduce compatibility issues if other parts of the codebase rely on features or bug fixes present only in the newer version. Ensure that this change is intentional and that all dependencies are compatible with this version.

Comment thread pnpm-lock.yaml
cors: 2.8.5
express: 5.1.0
express: 4.22.1

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ security]
The downgrade of express from version 5.1.0 to 4.22.1 might lead to missing features or security patches available in the newer version. Verify that this downgrade does not affect the application's functionality or security.

Comment thread pnpm-lock.yaml
@@ -4800,62 +5119,75 @@ snapshots:
transitivePeerDependencies:
- chokidar

'@nestjs/swagger@11.2.1(@nestjs/common@11.1.7(class-transformer@0.5.1)(class-validator@0.14.2)(reflect-metadata@0.2.2)(rxjs@7.8.2))(@nestjs/core@11.1.7)(class-transformer@0.5.1)(class-validator@0.14.2)(reflect-metadata@0.2.2)':
'@nestjs/swagger@11.2.5(@nestjs/common@11.1.12(class-transformer@0.5.1)(class-validator@0.14.3)(reflect-metadata@0.2.2)(rxjs@7.8.2))(@nestjs/core@11.1.12)(class-transformer@0.5.1)(class-validator@0.14.3)(reflect-metadata@0.2.2)':

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ maintainability]
The update from @nestjs/swagger@11.2.1 to @nestjs/swagger@11.2.5 and related dependencies seems fine, but ensure that the new version is compatible with the rest of your application and that any breaking changes have been addressed.

Comment thread pnpm-lock.yaml

'@nestjs/testing@11.1.7(@nestjs/common@11.1.7(class-transformer@0.5.1)(class-validator@0.14.2)(reflect-metadata@0.2.2)(rxjs@7.8.2))(@nestjs/core@11.1.7)(@nestjs/platform-express@11.1.7)':
'@nestjs/swagger@7.4.2(@nestjs/common@10.4.22(class-transformer@0.5.1)(class-validator@0.14.3)(reflect-metadata@0.1.14)(rxjs@7.8.2))(@nestjs/core@10.4.22)(class-transformer@0.5.1)(class-validator@0.14.3)(reflect-metadata@0.1.14)':

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
The introduction of @nestjs/swagger@7.4.2 with older dependencies like @nestjs/common@10.4.22 and reflect-metadata@0.1.14 could lead to compatibility issues if the rest of the application is using newer versions. Verify that this older version is necessary and compatible with your current setup.

Comment thread pnpm-lock.yaml
'@pkgjs/parseargs@0.11.0':
optional: true

'@pkgr/core@0.2.9': {}

'@prisma/client@6.18.0(prisma@6.18.0(typescript@5.9.3))(typescript@5.9.3)':
'@prisma/client@6.19.2(prisma@6.19.2(typescript@5.9.3))(typescript@5.9.3)':

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ maintainability]
The update of @prisma/client from 6.18.0 to 6.19.2 should be checked for any breaking changes or deprecations that might affect your application. Ensure that the new version is fully compatible with your existing codebase.

Comment thread pnpm-lock.yaml
axios@1.12.2:
atomic-sleep@1.0.0: {}

axios@0.30.2:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ security]
The downgrade of axios from version 1.12.2 to 0.30.2 could introduce compatibility or security issues. Ensure that this change is intentional and that any breaking changes or vulnerabilities in the older version are addressed.

Comment thread pnpm-lock.yaml
@@ -5673,16 +6043,33 @@ snapshots:
inherits: 2.0.4
readable-stream: 3.6.2

body-parser@2.2.0:
body-parser@1.20.4:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
The downgrade of body-parser from version 2.2.0 to 1.20.4 could potentially introduce compatibility issues or missing features. Ensure that this change is intentional and that the older version meets all current requirements.

Comment thread pnpm-lock.yaml
transitivePeerDependencies:
- supports-color

body-parser@2.2.2:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
The addition of a new version 2.2.2 for body-parser alongside the downgraded version 1.20.4 might cause conflicts or unexpected behavior. Verify that both versions are necessary and that their coexistence does not lead to issues.

Comment thread pnpm-lock.yaml
@@ -6180,39 +6602,76 @@ snapshots:
jest-mock: 30.2.0
jest-util: 30.2.0

express@5.1.0:
express@4.22.1:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
The downgrade from express@5.1.0 to express@4.22.1 could introduce compatibility issues or missing features that were present in version 5. Ensure that the application is tested thoroughly to confirm that it still functions correctly with this older version.

Comment thread pnpm-lock.yaml
@@ -6297,7 +6753,19 @@ snapshots:
dependencies:
to-regex-range: 5.0.1

finalhandler@2.1.0:
finalhandler@1.3.2:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ security]
The downgrade from finalhandler@2.1.0 to finalhandler@1.3.2 could introduce potential security vulnerabilities or bugs that were fixed in later versions. Ensure that this version change is intentional and that any security implications have been assessed.

Comment thread pnpm-lock.yaml
semver@6.3.1: {}

semver@7.7.3: {}

send@1.2.0:
send@0.19.2:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
The downgrade of send from version 1.2.1 to 0.19.2 could potentially introduce compatibility issues or missing features that were present in the newer version. Ensure that this change is intentional and that the older version meets all current requirements.

Comment thread pnpm-lock.yaml
dependencies:
axios: 0.30.2
bunyan: 1.8.15
jsonwebtoken: 9.0.3

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ security]
The jsonwebtoken package is updated to version 9.0.3. Ensure that this version is compatible with your current implementation, as major version changes can introduce breaking changes.

Comment thread pnpm-lock.yaml
axios: 0.30.2
bunyan: 1.8.15
jsonwebtoken: 9.0.3
jwks-rsa: 3.2.2

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ security]
The jwks-rsa package is updated to version 3.2.2. Verify that this version is compatible with your current implementation, as updates can introduce breaking changes or new security features.

Comment thread pnpm-lock.yaml
bunyan: 1.8.15
jsonwebtoken: 9.0.3
jwks-rsa: 3.2.2
lodash: 4.17.23

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ security]
The lodash package is updated to version 4.17.23. Ensure that this version addresses any known vulnerabilities and is compatible with your current codebase.

export const getBaClient = () => {
if (!baPrismaClient) {
if (!ENV_CONFIG.BILLING_ACCOUNTS_DB_URL) {
throw new Error(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
The error message references CHALLENGES_DB_URL instead of BILLING_ACCOUNTS_DB_URL. This could lead to confusion when debugging. Ensure the error message accurately reflects the environment variable being checked.

@vas3a
vas3a requested a review from kkartunov January 28, 2026 16:37
@vas3a
vas3a merged commit 83bcf6d into dev Jan 29, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants